describe("Aliquot sum", function()
	local aliquot_sum = require("math.aliquot_sum")

	it("should handle general cases", function()
		assert.equal(0, aliquot_sum(1))
		assert.equal(1, aliquot_sum(2))
		assert.equal(1, aliquot_sum(3))
		assert.equal(1 + 2, aliquot_sum(4))
		assert.equal(1, aliquot_sum(5))
		assert.equal(1 + 2 + 3, aliquot_sum(6))
		assert.equal(1, aliquot_sum(7))
		assert.equal(1 + 2 + 4, aliquot_sum(8))
		assert.equal(1 + 3, aliquot_sum(9))
		assert.equal(106, aliquot_sum(80))
		assert.equal(114, aliquot_sum(102))
		assert.equal(312, aliquot_sum(168))
		assert.equal(14, aliquot_sum(169))
		assert.equal(154, aliquot_sum(170))
		assert.equal(89, aliquot_sum(171))
		assert.equal(533, aliquot_sum(1771))
		assert.equal(7044, aliquot_sum(7852))
	end)

	it("should throw error when input is 0", function()
		assert.has_error(function()
			aliquot_sum(0)
		end)
	end)

	it("should throw error when input is negative", function()
		assert.has_error(function()
			aliquot_sum(-1)
		end)
	end)
end)
